package niit.wei.controller;

import niit.wei.service.BaiDuIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @Author WeiJinLong
 * @Date 2023-08-16 22:08
 * @Version 1.0
 */
@Controller
public class BaiDuIndexController {
    @Autowired
    private BaiDuIndexService baiDuIndexService;

    @RequestMapping("search")
    @ResponseBody
    public Map<String,Object> getBaiDuIndex(@RequestParam("key") String key){
        Map<String, Object> map = baiDuIndexService.getTimes(key);
        return map;
    }
}
